package openadmin.widgets.swing;

import java.awt.Insets;
import java.util.ResourceBundle;
import java.util.Set;
import javax.swing.JToolBar;


/**
 * Template ToolBar
 * Provides a component that is useful for displaying commonly used Actions or controls
 * @version  0.1
 * Created 10-05-2009
 * Author Alfred Oliver
 */
public class TemplateJtoolBar01 extends JToolBar {
	
	private ResourceBundle language =ResourceBundle.getBundle("messages_es");
	
	/**	  	
	  * Constructs a new ToolBar with the information of the actions methods, and object and language. 
	  * @param pActions. Information of action method. 
	  * @param pObject Object containing the methods to invoke  	 
	  * @param pLanguage resource language. 	  
	  */
	public TemplateJtoolBar01(Set<String> pActions, Object pObject, ResourceBundle pLanguage){
	
		if (pLanguage != null){
			
			language = pLanguage;
		}
		Insets marge =  new Insets(5, 5, 5, 5);
		this.setRollover(true);
		this.setMargin(marge);
		this.setFloatable(false);
		
		for (String o: pActions){
			
			this.addSeparator();
			this.add(new TemplateJbuttont01(language.getString(o), pObject, o));
			this.addSeparator();
			
			
		}
		
		
	}
	
}
